<?php 

Class appModel extends Model
{

	public function get_cfg($key='')
	{
		if($key)
		{
			$sql="SELECT op_value FROM ".$this->table('options')." WHERE op_key='".$key."'";
			$arr=$this->getOne($sql);
			
		}
		else 
		{
		   $sql="SELECT * FROM ".$this->table('options')." ";
		   $arr=array();
		   $res=$this->getAll($sql);
		   
		   if(count($res)>0)
		  {
			  foreach($res as $k=>$v)
			  {
				$arr[$v['op_key']]=$v['op_value'];
			  }
		   }
		}
		
		return $arr;
	}
}